<?php

namespace App\Http\Controllers\Admin\Module;

use App\Model\Lost;
use App\Repository\LostRepository;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class LostController extends Controller
{
    /**
     * @var LostRepository
     */
    private $lost;

    /**
     * LostController constructor.
     * @param LostRepository $lost
     */
    public function __construct(LostRepository $lost)
    {
        $this->middleware('permission:lost_manage');
        $this->lost = $lost;
    }

    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index(Request $request)
    {
        $losts = $this->lost->search($request->all());

        $finish = $this->lost->getFinishCount(true);

        $publishers = $this->lost->getCateringPublishers();

        $operators = $this->lost->getCateringOperators();

        $statuses = Lost::$statusArray;

        $roles = Lost::$roleArray;

        return view('admin.module.lost.index', compact('losts', 'publishers', 'operators', 'statuses', 'roles', 'finish'));
    }

    /**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function create()
    {
        //
    }

    /**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
    public function store(Request $request)
    {
        //
    }

    /**
     * Display the specified resource.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function show($id)
    {
        //
    }

    /**
     * Show the form for editing the specified resource.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function edit($id)
    {
        //
    }

    /**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function update(Request $request, $id)
    {
        //
    }

    /**
     * Remove the specified resource from storage.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function destroy($id)
    {
        //
    }
}
